package com.lin.linchatgpt.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import java.io.Serializable;
import java.time.LocalDateTime;

import com.mybatisflex.core.keygen.KeyGenerators;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 *  实体类。
 *
 * @author 15898
 * @since 2023-07-18
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(value = "chat_image")
public class Image implements Serializable {

    /**
     * 主键
     */
    @Id(value = "uuid", keyType = KeyType.Generator)
    private String id;

    /**
     * 生成图片的Id
     */
    private String imageId;

    /**
     * 生成图片的地址
     */
    private String imageUrl;

    /**
     * 用户id
     */
    private String userId;

    /**
     * 提示词
     */
    private String prompt;

    /**
     * 1:使用Midjourney生成；2:使用chatGPT生成
     */
    private Integer model;

    /**
     * 保存可以对图片进行的操作
     */
    private String[] actions;

    /**
     * 逻辑删除；0：正常,1：已经删除
     */
    @Column(isLogicDelete = true)
    private Integer isDelete;

    /**
     * 创建时间
     */
    @Column(onInsertValue = "now()")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @Column(onUpdateValue = "now()")
    private LocalDateTime modifyTime;

}
